package com.ruoyi.master.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.master.mapper.AchievementMapper;
import com.ruoyi.master.domain.Achievement;
import com.ruoyi.master.service.IAchievementService;

/**
 * 成就条件Service业务层处理
 * 
 * @author jiandan
 * @date 2024-10-23
 */
@Service
public class AchievementServiceImpl implements IAchievementService 
{
    @Autowired
    private AchievementMapper achievementMapper;

    /**
     * 查询成就条件
     * 
     * @param achievementId 成就条件主键
     * @return 成就条件
     */
    @Override
    public Achievement selectAchievementByAchievementId(Long achievementId)
    {
        return achievementMapper.selectAchievementByAchievementId(achievementId);
    }

    /**
     * 查询成就条件列表
     * 
     * @param achievement 成就条件
     * @return 成就条件
     */
    @Override
    public List<Achievement> selectAchievementList(Achievement achievement)
    {
        return achievementMapper.selectAchievementList(achievement);
    }

    /**
     * 新增成就条件
     * 
     * @param achievement 成就条件
     * @return 结果
     */
    @Override
    public int insertAchievement(Achievement achievement)
    {
        achievement.setCreateTime(DateUtils.getNowDate());
        return achievementMapper.insertAchievement(achievement);
    }

    /**
     * 修改成就条件
     * 
     * @param achievement 成就条件
     * @return 结果
     */
    @Override
    public int updateAchievement(Achievement achievement)
    {
        achievement.setUpdateTime(DateUtils.getNowDate());
        return achievementMapper.updateAchievement(achievement);
    }

    /**
     * 批量删除成就条件
     * 
     * @param achievementIds 需要删除的成就条件主键
     * @return 结果
     */
    @Override
    public int deleteAchievementByAchievementIds(Long[] achievementIds)
    {
        return achievementMapper.deleteAchievementByAchievementIds(achievementIds);
    }

    /**
     * 删除成就条件信息
     * 
     * @param achievementId 成就条件主键
     * @return 结果
     */
    @Override
    public int deleteAchievementByAchievementId(Long achievementId)
    {
        return achievementMapper.deleteAchievementByAchievementId(achievementId);
    }
}
